package org.cogate.thrift.server.conf;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**   
 * @Title: UserServiceZookeeperConfig.java 
 * @Description: 服务端服务注册配置
 * @author dongliangwu
 * @date 2017年2月7日
 * @version V1.0   
 */
@Configuration
public class ServiceZookeeperConfig {
	/*@Value("${service.name}")
	String serviceName;
	
	@Value("${zookeeper.server.list}")
	String serverList;
	
	@Value("${thread.pool.size}")
    int threadPoolSize;
	
	@Value("${time.to.sleep}")
	long timeToSleep;
	
	@Value("${server.socket.port}")
	int tServerSocketPort;
	
	ExecutorService executor; 
	
	@PostConstruct
	public void init(){
		executor = Executors.newFixedThreadPool(threadPoolSize);
		executor.execute(new Runnable() {			
			@Override
			public void run() {
				ZooKeeperConfig zookeeperConfig = new ZooKeeperConfig();
				zookeeperConfig.registService(serviceName,serverList,tServerSocketPort);				
				try {
					Thread.sleep(timeToSleep);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		});
	}*/
}
